package org.groupg.practice.mvstore;

import org.h2.mvstore.MVMap;
import org.h2.mvstore.MVStore;

import java.io.File;
import java.io.IOException;

import static org.groupg.practice.StaticParam.buidFile;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        // open the store (in-memory if fileName is null)
        File file = new File(buidFile,"demo01.mvstore");
        if (!file.exists()) {
            file.getParentFile().mkdirs();
            file.createNewFile();
        }
        MVStore s = MVStore.open(file.getAbsolutePath());

// create/get the map named "data"
        MVMap<Integer, String> map = s.openMap("data");

// add and read some data
//        map.put(1, "Hello World");
        System.out.println(map.get(1));

// close the store (this will persist changes)
        s.close();
    }
}
